package com.camerax.sample

import android.net.Uri
import androidx.navigation.findNavController
import com.camerax.sample.base.BaseFragment
import com.camerax.sample.databinding.FragmentPreviewBinding

/**
 * date        ：2020/11/30
 * author      ：秦川小将
 * description ：
 */
class PreviewFragment: BaseFragment<FragmentPreviewBinding>() {

    override fun layoutResId() = R.layout.fragment_preview

    override fun initView() {}

    override fun loadData() {
        arguments?.getString(CameraCompat.TAKE_PICTURE_RESULT)?.let {
            binding.preview.setImageURI(Uri.parse(it))
        }
    }

    override fun onBackPressed() {
        requireActivity().findNavController(R.id.host_fragment_container).navigate(R.id.to_camera_fragment)
    }
}